Skip to main content

Practice on how to change the username in cmd

· 5 Minutes to read
Allen Ma

Preface

I'm sure few of you are like me After buying a new computer or reinstalling a system The excitement is overwhelming You can't help but want to give your new baby a name that is unique in the world Unfortunately What we call elation is merely a mechanism by which the brain persuades us to work hard over a period of time to get something in return This reward makes us feel good (love comes hard) But it slips away Leaving us in front of the computer with the "indescribable" username QAQ

Translated with www.DeepL.com/Translator (free version) 在这里插入图片描述

Main article

In order to solve the mistakes I had made, I asked for help from various bigwigs on the Internet, but my disciples were foolish and made many mistakes, so I am recording them here to avoid the pitfalls for those who have the same needs.、

Methods

To change your username in ==win10 non-home edition== in ==cmd==.

When we register our original account the Win10 system will create a new account for us and we can see a familiar name under the path C:\Users (the one you've dreamed of changing). 在这里插入图片描述

OK, now we have found the source. I then tried right clicking on the original name folder and looking for the "Rename" option. If you have tried this as I did, unfortunately, it doesn't work. The system doesn't seem to want to give you the chance to correct your mistake, "rename" doesn't exist.

When in trouble, Ollie gives! Find out why! As we are logged in with this username, the system has triggered this protection mechanism to avoid confusion. At this point we need a new user to do this for us, for the following reasons.

I think it can be simplified to a classic basket problem. There are two baskets, basket A with ball 1 and basket B with ball 2. Now we want to swap the balls in these two baskets. Step 1: Take a new empty basket C. Step 2: Move ball 1 into basket C. Step 3: Move ball 2 into basket C. Step 3: Move ball 2 into the empty basket A. Finally, move ball 1 into basket B.

Translated with www.DeepL.com/Translator (free version)

So, we need a third party account first. This is why it's ==win10 non-home edition==, as far as I know this edition doesn't have local users and groups as a feature, sigh of relief.

The first step is to find a new account, the user-friendly Win gives us some built in, such as Administrator which I intend to use, but these accounts are disabled by default and we need to enable them manually. The Administrator account is enabled by Right click on This PC, then find Manage and click on it, find Local Users and Groups, click on Users and Administrator in turn, check its properties, a small box will appear, you can see that the account has been disabled that is ticked, remove this tick, click OK, you can choose to use Administrator login is now available.

Translated with www.DeepL.com/Translator (free version) 在这里插入图片描述

Log out of your current account, this can be done via Logout in Start.

在这里插入图片描述 After logging out, choose to log in using Administrator on the next boot, log in and go to the path: C:\Users Right click again on the username you want to change and you will be surprised to find Rename appear! Then change it to the name of your choice. (Since I changed it, I won't demonstrate) 在这里插入图片描述

Then go back to the desktop, press win+R to bring up the Run window, type regedit to search to open the Registry Editor, then in the search box, type

    Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersio\ProfileList

Find the longest package in the ProfileList folder, then right-click on one of the ProfileImagePath and select Modify, as shown in the image

在这里插入图片描述

Then in the edit string change the name to the renamed one on the C drive to be sure.

在这里插入图片描述 Finally, switch back to our old account, log out of Administrator and then boot up and choose to log into our own account.

To view the results in cmd. 在这里插入图片描述

P.S.

After changing the username, the environment variables and system variables we set before need to be updated manually, otherwise the program will not respond or the file will not open. Please be sure to pay attention!!!